package j01neibulei;
/*
创建实例
1，创建类，new类
2，匿名内部类
3，lambda，函数接口
4，方法引用
 */

interface I1{
    void f1();
}

interface K1{
    int sum(int a,int b);
}

class Cat{
    static void say(){
        System.out.println("秒！");
    }
    static void cry(){
        System.out.println("小猫哭了！");
    }
    static int abc(int m,int n){
        return m+n;
    }
}
public class J2 {
    public static void main(String[] args) {
        I1 i1 = Cat::say;
        i1.f1();

        I1 i2 = Cat::cry;
        i2.f1();
        System.out.println("====");
//        K1 k1 = Cat::cry;
        K1 k1 = Cat::abc;
        System.out.println("k1.sum(3,5) = " + k1.sum(3, 5));
    }
}
